#ifndef PAGEPISMODESETTING_H
#define PAGEPISMODESETTING_H

#include <QWidget>
#include <QTimer>
#include "globalconfig.h"

namespace Ui {
class PagePisModeSetting;
}

class PagePisModeSetting : public QWidget
{
    Q_OBJECT

public:
    explicit PagePisModeSetting(QWidget *parent = nullptr);
    ~PagePisModeSetting();
    void setPageActive(bool xActive);
    void syncPisMode(int mode);
    void syncLineDirection(uint8_t dir);

    uint8_t getCurrentPISMode() const;
    uint8_t getCurrentDirection() const;
signals:
    void signal_set_pis_mode(int mode,bool xSet);
    void signal_change_direction(uint8_t dir);
private slots:
    void on_Btn_PisAuto_clicked(bool checked);
    void on_Btn_PisSemiAuto_clicked(bool checked);
    void on_Btn_PisManual_clicked(bool checked);
    void on_Btn_PisUpWard_pressed();
    void on_Btn_PisDownWard_pressed();
    void on_Btn_ModeConfirm_clicked();
    void on_Btn_DirectionConfirm_clicked();

private:
    Ui::PagePisModeSetting *ui;
private:
    int current_pis_mode_;
    uint8_t current_direction_;
    bool btns_enable_;
};

#endif // PAGEPISMODESETTING_H
